//    Copyright (C) Clear Office.  All rights reserved.
using System;
using Office.Core.Serialization;

namespace Office.Spreadsheet.PivotTable
{
    internal class RowColumnIndex : IOfficeXmlSerializable
    {
        private int _v;

        public void ReadXml(ReadContext context)
        {
            using (var c = context.Read("x"))
            {
                _v = c.GetOptionalInteger("v", 0);
            }
        }

        public void WriteXml(WriteContext context)
        {
            using (var c = context.Write("x"))
            {
                c.SetOptionalInteger("v", _v, 0);
            }
        }
    }
}